<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">

    <!--.self 只有点击当前元素时候才会出发事件-->
    <!--<div @click.self="divdian">-->
        <!--<input type="button" value="点我" @click="dianwo">-->
    <!--</div>-->


    <!--.stop阻止冒泡-->
    <!--<div @click="divdian">-->
        <!--<input type="button" value="点我" @click.stop="dianwo">-->
    <!--</div>-->
    <!---->
    <!--.capture  捕获事件-->
    <!--<div @click.capture="divdian">-->
        <!--<input type="button" value="点我" @click="dianwo">-->
    <!--</div>-->
    <!--.prevent阻止默认行为-->
    <a href="http://www.baidu.com" @click.prevent="linkdian">有问题百度</a>
</div>

<script src="lib/vue.js"></script>
<script>
    var vm=new Vue({
        el:"#app",
        data:{},
        methods:{
            dianwo:function () {
                console.log("aha")
            },
            divdian:function () {
                console.log("maopaola")
            },
            linkdian(){
                console.log("跳转了哈哈")
            }
        }
    })
</script>
</body>
</html>